package com.share.lottery.adapter;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.lidroid.xutils.BitmapUtils;
import com.share.lottery.R;
import com.share.lottery.model.BulletinBean;
import com.share.lottery.model.CaiboRmdBean;

/**
 * @author py
 *倍投结果
 */
public class BtjgAdapter extends BaseAdapter {
	private BitmapUtils bitmapUtils;
	private List<Integer> userList = new ArrayList<Integer>();
	private  Context context;
	public BtjgAdapter(Context context) {
		this.context = context;
		if (bitmapUtils == null) {
			bitmapUtils = new BitmapUtils(context);
		}
	}
	public int getCount() {

		return userList.size();
	}


	public Integer getItem(int arg0) {

		return userList.get(arg0);
	}


	public long getItemId(int arg0) {

		return arg0;
	}


	public View getView(int position, View convertView, ViewGroup arg2) {
		Integer caiboRmdBean = userList.get(position);
		ViewHolder viewHolder = null;
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(
					R.layout.item_btjg, null);
			viewHolder = new ViewHolder();
			viewHolder.tvBqtr = (TextView) convertView.findViewById(R.id.tv_bqtr);
			viewHolder.tvLjtr = (TextView) convertView.findViewById(R.id.tv_ljtr);
			viewHolder.tvZjje = (TextView) convertView.findViewById(R.id.tv_zjje);
			viewHolder.tvSyje = (TextView) convertView.findViewById(R.id.tv_syje);
			viewHolder.tvSyl = (TextView) convertView.findViewById(R.id.tv_syl);
			convertView.setTag(viewHolder);
		} else {
			viewHolder = (ViewHolder) convertView.getTag();
		}
	


		return convertView;
	}
	class ViewHolder {
		TextView tvBqtr;
		TextView tvLjtr;
		TextView tvZjje;
		TextView tvSyje;
		TextView tvSyl;

	}

	/**
	 * 添加数据
	 * 
	 * @param rows
	 */
	public void addDatas(List<Integer> rows) {

		userList.addAll(rows);

		notifyDataSetChanged();
	}

	/**
	 * 清空数据
	 */
	public void clearDatas() {

		userList.clear();
		notifyDataSetChanged();
	}

}
